<template>
  <div class="airport-picker">
    <!-- <span>机场选择&nbsp;</span> -->
    <el-select
      v-model="pickedAirport"
      filterable
      placeholder="请选择机场"
      @change="change"
    >
      <el-option
        v-for="item in airportList"
        :key="item"
        :label="item"
        :value="item"
      >
        <span style="float: left">{{ item }}</span>
      </el-option>
    </el-select>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref, watch } from 'vue';
export default defineComponent({
  name: 'AirportPicker',
  props: {
    airport: String,
  },
  setup(props, context) {
    const airportList = ref(['上海虹桥机场', '首都国际机场']);
    const pickedAirport = ref('上海虹桥机场');
    const change = () => {
      console.log('pickedAirport.value: ', pickedAirport.value);
      context.emit('update:airport', pickedAirport.value);
    };
    return {
      pickedAirport,
      airportList,
      change,
    };
  },
});
</script>

<style lang="scss" scoped>
@import '@/assets/css/config.scss';
.el-select-dropdown__item.selected {
  color: $themeLight;
}
.el-range-editor.is-active,
.el-range-editor.is-active:hover,
.el-select .el-input.is-focus :deep(.el-input__inner) {
  border-color: $themeRed !important;
}
.el-input__inner {
  border-color: $themeRed !important;
}
</style>
